<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><s:property value="page.title"/></title>
    <meta name="heading" content="<s:property value="page.heading"/>"/>
</head>

<s:set name="isExistingPerson" value="%{person.id != null}" />

<s:form>
  <s:hidden name="person.id" value="%{person.id}"/>
  <s:textfield key="person.firstName" /> 
  <s:textfield key="person.lastName" />

  <li>
    <s:if test="%{#isExistingPerson}">
      <s:submit cssClass="button" action="delete" key="button.delete" theme="simple" />
      <s:submit cssClass="button" action="edit" key="button.edit" theme="simple"/>
    </s:if>
    <s:else>
      <s:submit cssClass="button" action="save" key="button.save" theme="simple"/>
    </s:else>
    <s:submit cssClass="button" action="list" key="button.cancel" theme="simple"/>
  </li>
</s:form>